﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGeSurfSurfInt : OdGeEntity3d
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGeSurfSurfInt(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGeSurfSurfInt_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGeSurfSurfInt obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGeSurfSurfInt()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGeSurfSurfInt(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public OdGeSurfSurfInt() : this(GlobalsPINVOKE.new_OdGeSurfSurfInt__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeSurfSurfInt(OdGeSurface srf1, OdGeSurface srf2, OdGeTol tol) : this(GlobalsPINVOKE.new_OdGeSurfSurfInt__SWIG_1(OdGeSurface.getCPtr(srf1), OdGeSurface.getCPtr(srf2), OdGeTol.getCPtr(tol)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeSurfSurfInt(OdGeSurface srf1, OdGeSurface srf2) : this(GlobalsPINVOKE.new_OdGeSurfSurfInt__SWIG_2(OdGeSurface.getCPtr(srf1), OdGeSurface.getCPtr(srf2)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeSurfSurfInt(OdGeSurfSurfInt source) : this(GlobalsPINVOKE.new_OdGeSurfSurfInt__SWIG_3(OdGeSurfSurfInt.getCPtr(source)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeSurface surface1()
		{
			IntPtr intPtr = GlobalsPINVOKE.OdGeSurfSurfInt_surface1(this.swigCPtr);
			OdGeSurface result = (intPtr == IntPtr.Zero) ? null : new OdGeSurface(intPtr, false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeSurface surface2()
		{
			IntPtr intPtr = GlobalsPINVOKE.OdGeSurfSurfInt_surface2(this.swigCPtr);
			OdGeSurface result = (intPtr == IntPtr.Zero) ? null : new OdGeSurface(intPtr, false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeTol tolerance()
		{
			OdGeTol result = new OdGeTol(GlobalsPINVOKE.OdGeSurfSurfInt_tolerance(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public int numResults(ref OdGe.OdGeIntersectError status)
		{
			int result = GlobalsPINVOKE.OdGeSurfSurfInt_numResults(this.swigCPtr, ref status);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeCurve3d intCurve(int intNum, bool isExternal, ref OdGe.OdGeIntersectError status)
		{
			OdGeCurve3d result = new OdGeCurve3d(GlobalsPINVOKE.OdGeSurfSurfInt_intCurve(this.swigCPtr, intNum, isExternal, ref status), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeCurve2d intParamCurve(int intNum, bool isExternal, bool isFirst, ref OdGe.OdGeIntersectError status)
		{
			OdGeCurve2d result = new OdGeCurve2d(GlobalsPINVOKE.OdGeSurfSurfInt_intParamCurve(this.swigCPtr, intNum, isExternal, isFirst, ref status), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d intPoint(int intNum, ref OdGe.OdGeIntersectError status)
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGeSurfSurfInt_intPoint(this.swigCPtr, intNum, ref status), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void getIntPointParams(int intNum, OdGePoint2d param1, OdGePoint2d param2, ref OdGe.OdGeIntersectError status)
		{
			GlobalsPINVOKE.OdGeSurfSurfInt_getIntPointParams(this.swigCPtr, intNum, OdGePoint2d.getCPtr(param1), OdGePoint2d.getCPtr(param2), ref status);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getIntConfigs(int intNum, ref OdGe.ssiConfig surf1Left, ref OdGe.ssiConfig surf1Right, ref OdGe.ssiConfig surf2Left, ref OdGe.ssiConfig surf2Right, ref OdGe.ssiType intType, out int dim, ref OdGe.OdGeIntersectError status)
		{
			GlobalsPINVOKE.OdGeSurfSurfInt_getIntConfigs(this.swigCPtr, intNum, ref surf1Left, ref surf1Right, ref surf2Left, ref surf2Right, ref intType, out dim, ref status);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public int getDimension(int intNum, ref OdGe.OdGeIntersectError status)
		{
			int result = GlobalsPINVOKE.OdGeSurfSurfInt_getDimension(this.swigCPtr, intNum, ref status);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGe.ssiType getType(int intNum, ref OdGe.OdGeIntersectError status)
		{
			OdGe.ssiType result = (OdGe.ssiType)GlobalsPINVOKE.OdGeSurfSurfInt_getType(this.swigCPtr, intNum, ref status);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeSurfSurfInt set(OdGeSurface srf1, OdGeSurface srf2, OdGeTol tol)
		{
			OdGeSurfSurfInt result = new OdGeSurfSurfInt(GlobalsPINVOKE.OdGeSurfSurfInt_set__SWIG_0(this.swigCPtr, OdGeSurface.getCPtr(srf1), OdGeSurface.getCPtr(srf2), OdGeTol.getCPtr(tol)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeSurfSurfInt set(OdGeSurface srf1, OdGeSurface srf2)
		{
			OdGeSurfSurfInt result = new OdGeSurfSurfInt(GlobalsPINVOKE.OdGeSurfSurfInt_set__SWIG_1(this.swigCPtr, OdGeSurface.getCPtr(srf1), OdGeSurface.getCPtr(srf2)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeSurfSurfInt Assign(OdGeSurfSurfInt surfSurfInt)
		{
			OdGeSurfSurfInt result = new OdGeSurfSurfInt(GlobalsPINVOKE.OdGeSurfSurfInt_Assign(this.swigCPtr, OdGeSurfSurfInt.getCPtr(surfSurfInt)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
